import request from '@/utils/request'
//用户登录接口
export const regisApi = (val1, val2) =>
  request({
    url: '/user/login',
    method: 'post',
    data: {
      username: val1,
      password: val2
    }
  })
//账号注册
export const zhuceApi = (val1, val2) =>
  request({
    url: '/user/registered',
    method: 'post',
    data: {
      username: val1,
      password: val2
    }
  })
//获取用户数据
export const uesrinfo = () =>
  request({
    url: '/user'
  })
//退出接口
export const longout = () =>
  request({
    url: '/user/logout',
    method: 'post'
  })
/**
 * 上传图片
 * @param {*} val
 * @returns
 */
export const pluginChanGeApi = (val) => {
  return request({
    url: '/houses/image',
    method: 'POST',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: val
  })
}
/**
 *
 * @returns
 */
export const userHousesApi = (data) => {
  return request({
    url: '/user/houses',
    method: 'POST',
    data
  })
}
export const mapgetApi = (id) => {
  return request({
    url: '/area/map',
    params: {
      id
    }
  })
}
